import request from '@/utils/request'

export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    'params': params
  })
}

export function deleteRoles(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

/**
 *
 * @description：新增角色
 * @param{*} data {name, description}
 * @returns {*}
 */
export function addRoles(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}

export function updateRoles(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}

